package ls.vuecp.gui;

import javax.swing.JFrame;
import javax.swing.RootPaneContainer;

public class VueFrame extends JFrame
{
	private static VueFrame mthis= null;
	public static VueFrame getVueFrame() { if( mthis == null ) mthis = new VueFrame(); return mthis;} 
	public VueFrame()
	{
		this("Vuels");
	}
	public VueFrame(String title)
	{
		super(title);
		mthis = this;
		
		this.setDefaultCloseOperation(this.EXIT_ON_CLOSE);//(this.DO_NOTHING_ON_CLOSE);
	    setName("VueFrame" + sNameIndex++);
	    setRootPaneNames(this, getName());
	}
	
	private static int sNameIndex = 0;
	
	public void setRootPaneNames(RootPaneContainer r, String name) 
	{
        r.getRootPane().setName(name + ".root");
        r.getContentPane().setName(name + ".content");
        r.getLayeredPane().setName(name + ".layer");
        r.getGlassPane().setName(name + ".glass");
    }
	public void addComp(java.awt.Component c, String constraints)
	{
		getContentPane().add(c,constraints);
	}
}
